/*
 * File      : geo_list.h
 * Change Logs:
 * Date           Author       Notes
 * 2013-07-27    jimmy.lee    first version
 */

#ifndef __GEO_LIST_H__
#define __GEO_LIST_H__

#include <rtgui/rtgui.h>
#include <rtgui/image.h>
#include <rtgui/rtgui_system.h>
#include <rtgui/widgets/widget.h>
#include "geo_items.h"

struct geo_list_item
{
	char *text;
	rt_bool_t (*action)(struct rtgui_object *object, void *args);
	void *parameter;
};
DECLARE_TAG(geo_list_item);

DECLARE_CLASS_TYPE(geolist);
#define GEO_LIST_TYPE      (RTGUI_TYPE(geolist))
#define GEO_LIST(obj)      (RTGUI_OBJECT_CAST((obj), GEO_LIST_TYPE, geo_list_t))
#define IS_GEO_LIST(obj)   (RTGUI_OBJECT_CHECK_TYPE((obj), GEO_LIST_TYPE))

struct geo_list
{
    struct rtgui_widget parent;
	struct geo_items *items;
	geo_controller_t controller;
};
typedef struct geo_list geo_list_t;

geo_list_t *geo_list_create(rtgui_rect_t *rect, geo_items_t *items);	// geo_controller_t controller)
void geo_list_destroy(geo_list_t *list);
rt_bool_t geo_list_controller(struct rtgui_object *object, int cmd, void *args);
rt_bool_t geo_list_event_handler(struct rtgui_object *object, struct rtgui_event *event);

#endif

